<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>网元管理</title>
<meta name="decorator" content="default"/>
<tags:import includes="spinner,bootbox,validate,maskedinput"></tags:import>
<script src="${ctxStatic}/modules/cfg/cfg.js"></script>
<script>

//上下文地址
var CONTEXT_URL = "/cfg/ne/";
var pageType = 'ne';
function refresh(){
	location.reload();
}

function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#frmSearch").submit();
	return false;
}
</script>
</head>
<body>
	<br>
	<form id="frmSearch" modelAttribute="item" action="${ctx}/cfg/ne/" method="post" class="breadcrumb form-search">
	  	<input id="pageNo" name="pageNo" type="hidden" value="${pages.pageNo}"/>		
		<input id="pageSize" name="pageSize" type="hidden" value="${pages.pageSize}"/>			
		&nbsp;&nbsp; <label>名称 ：</label><input type="text" name="nename" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnQuery" class="btn btn-success"" type="submit" value="查询"/>
		&nbsp;<input id="btnNew" class="btn"  type="button" value="新增"/>
		&nbsp;<input id="btnDelete" class="btn"  type="button"  value="删除" />
	</form>
	<br><br>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th class="center" style="width: 50px;"><label> <input
						type="checkbox" class="ace" /> <span class="lbl"></span>
				</label>
				</th>
				<th>名称</th>
				<th>类型</th>
				<th>IP</th>
				<th>启用</th>				
				<th>编辑</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${pages.list}" var="item">
			<tr>
				<td class="center">
					<label>
							<input value="${item.nid}" type="checkbox"  class="ace" /> 
							<span class="lbl"></span>
					</label>
				</td>
				<td>${item.nename}</td>
				<td>${fns:getDictLabel(item.netype,'mgr_card_type','N/A')}</td>
				<td>${item.ip}</td>
				<td>${fns:getDictLabel(item.enable,'yes_no','N/A')}</td>
				<td>
					<a href="javascript:onDelete('${item.nid}')">删除</a>
					<a href="javascript:onUpdate('${item.nid}')">编辑</a>					
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	${pages}	
	<!-- 模态窗体 -->
	<div id="modalTable" action="new" class="modal fade" tabindex="-1" style="display:none;width: 402px;height: 379px;">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 400px; height: 424px;">
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>新增窗体</span>
					</div>
				</div>
				<br>
				<!-- 新增窗体内部 -->
				<form id="frmSubmit" class="form-horizontal" role="form"  method="post">
					<input type="hidden" name="nid"  uname="update"/>
						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">站点：</label>
							<div class="col-sm-9">
								<widgets:select 
									datasource="${fns:getAllSiteDict()}" 
								    width="236"
								    uname="update"
								 	dictName="site.sid" 
								 	dataPlaceholder="字典类型">
								 </widgets:select>
							</div>
						</div>	
						
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">网元名称：</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="nename" uname="update"/>
							</div>
						</div>	
											
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">类型：</label>
							<div class="col-sm-9">
								<widgets:select 
									datasource="${fns:getDictList('mgr_ne_type')}" 
								    width="236"
								    uname="update"
								 	dictName="type" 
								 	dataPlaceholder="字典类型">
								 </widgets:select>
							</div>
						</div>	
					
						<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right"
							for="form-field-1"> 最大槽位： </label>

						<div class="col-sm-9">
							<input style="width: 195px;" 
								type="text"  
								placeholder="网元最大支持槽位数"
								class="col-xs-10 col-sm-5" 
								id="maxSlot" 
								value="4"
								name="maxslot" 
								uname="update"/>
						</div>
					</div>
										
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">IP：</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10 ipAddress"
									name="ip" uname="update"/>
							</div>
						</div>						
				       <div class="form-group">
				       		<label class="col-sm-3 control-label no-padding-right">启用</label>
							<div class="col-sm-9">
								<widgets:select 
									datasource="${fns:getDictList('yes_no')}" 
								    width="130"
								    uname="update"
								 	dictName="enable" 
								 	dataPlaceholder="字典类型">
								 </widgets:select>
							</div>
						</div>		
					<div class="space-4"></div>
					<div class="clearfix form-actions">
						<div class="center">
							<button id="btnSubmit" class="btn btn-info" type="button">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
						</div>
					</div>
				</form>
				<!-- PAGE CONTENT ENDS -->
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<widgets:treeview url="/sys/config/listCfgDTO/mgr_ne" 
  		callbackPID="callbackPID"
  		callbackPIDS="callbackPIDS"
		callbackName="callbackName">
	</widgets:treeview> 
</body>
</html>